package com.caochenlei.observer.system;

import java.util.Observable;
import java.util.Observer;

public class WebSite2 implements Observer {
    private Weather weather;

    public void display() {
        System.out.println("***** WebSite2 *****");
        System.out.println("温度：" + weather.getTemperature());
        System.out.println("湿度：" + weather.getHumidity());
        System.out.println("压力：" + weather.getPressure());
        System.out.println("********************");
    }

    @Override
    public void update(Observable o, Object arg) {
        this.weather = (Weather) arg;
        display();
    }
}
